<template>
  <div class="content">
      <el-dialog title="文件库" width="1280px" class="icon-dialog" top="5vh" :visible.sync="show" @open="open" :before-close="closeForm">
          <fileList ref="fileList" :fileList.sync="files" :limit="limit"></fileList>
          <div slot="footer" class="dialog-footer">
              <el-button size="medium" :loading="loading" type="primary" @click="submit" >确 定</el-button>
              <el-button size="medium" @click="closeForm">取 消</el-button>
          </div>
      </el-dialog>
  </div>
</template>

<script>
import fileList from './fileList.vue'
  export default {
    components: {
      fileList,
    },
    props: {
      show: {
          type: Boolean,
          default: false
      },
      limit: {
        type:Number,
        default: 0
      }
    },
    data() {
      return {
        loading: false,
        files: []
      }
    },
    methods: {
      open(){
        this.$nextTick(function () {
        })
      },

      submit(){
          this.$emit('imageFn',{files: this.files})
          this.$emit('update:show', false)
      },
      closeForm(){
        this.$emit('update:show', false)
        this.$emit('imageFn', {})
      },
    },
  }
</script>

<style lang="scss" scoped >
/deep/.v-modal {
  z-index: 100000;
}
/deep/.el-dialog__wrapper {
  z-index: 100000;
}
/deep/.el-dialog__body {
  padding-top: 5px;
}

</style>